package com.tdf.lolpanel.mapper;

import com.tdf.lolpanel.entity.Room;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;


@Mapper
public interface RoomMapper {

    /**
     * 根据id查找信息
     * @param id
     * @return
     */
    @Select("SELECT * FROM room WHERE id= #{id}")
    Room getById(Integer id);

    /**
     * 添加房间
     * @param room
     */
    @Insert("INSERT INTO room (name, ownerId, status, createdTime, updatedTime) " +
            "VALUES " +
            "(#{name}, #{ownerId}, #{status}, #{createdTime}, #{updatedTime})")
    void insert(Room room);
}
